package com.qibao.toolkit.exception.utils;

import org.springframework.util.StringUtils;

/**
 * @author wangcheng
 * @version $Id: ClassUtils.java, v0.1 2018/9/29 9:58 wangcheng Exp $$
 */
public class ClassUtils {

    private ClassUtils() throws IllegalAccessException {
        throw new IllegalAccessException("工具类不能被实例化");
    }

    /**
     * 将类名第一个字符转成小写
     */
    public static String firstCharToLower(String str) {

        if (StringUtils.isEmpty(str)) {
            throw new IllegalArgumentException("字符串不能为空");
        }

        char a = 'A';
        char z = 'Z';

        char c = str.charAt(0);
        if (a <= c && c <= z) {
            return (char) (c + 32) + str.substring(1);
        }
        return str;

    }
}
